#!/bin/sh

ROOTFS=$1
[ -d "$ROOTFS" ] || {
	echo "Cannot find rootfs directory: $ROOTFS" 1>&2
	exit 1
}

# $ROOTFS/etc/rsync-rootfs-version is used for comparing the version
# between local and remote rootfs when doing rsync.
if [ -f $ROOTFS/etc/version ];then
	cd $ROOTFS/etc && ln -s version rsync-rootfs-version
else
	date +%Y%m%d%H%M%S > $ROOTFS/etc/rsync-rootfs-version
fi
